#include <iostream>
#include <string>
#include <cstring>
using namespace std;

int add(int a, int b);
double add(double a, double b);
char add(char a, char b);

int add(int *pa, int *pb);
double add(double *pa, double *pb);
char *add(char *pa, char *pb);

int main()
{
	int a_i = 1, b_i = 2;
	double a_d = 1.5, b_d = 2.6;
	char a_c = 'a', b_c = '1';

	int pa_i = 2;
	int pb_i = 3;
	double pa_d = 2.5;
	double pb_d = 3.6;
	char pa_s[20] = "Hello ";
	char pb_s[20] = "World!";

	cout << "add() of int = " << add(a_i, b_i) << endl;
	cout << "add() of double = " << add(a_d, b_d) << endl;
	cout << "add() of char = " << (int)add(a_c, b_c) << endl;

	cout << "add() of int* = " << add(&pa_i, &pb_i) << endl;
	cout << "add() of double* = " << add(&pa_d, &pb_d) << endl;
	cout << "add() of char* = " << add(pa_s, pb_s) << endl;
}

int add(int a, int b)
{
	return (a + b);
}

double add(double a, double b)
{
	return (a + b);
}

char add(char a, char b)
{
	return (a + b);
}

int add(int *pa, int *pb)
{
	return (*pa + *pb);
}

double add(double *pa, double *pb)
{
	return (*pa + *pb);
}

char *add(char *pa, char *pb)
{
	return strcat(pa, pb);
}
